﻿using System;
using System.Configuration;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using Amazon.PAAPI.WCF;
using System.Threading;
using System.ComponentModel;
using System.Data.Sql;
using System.Data.SqlClient;
using Prices = Amazon.PAAPI.WCF.Price;
namespace Amazon.PAAPI
{
    class Program
    {
       
        static void Main(string[] args)
        {
            
            /*BrowseNodeLookupRequest request = new BrowseNodeLookupRequest();
            request.ResponseGroup = new string[] { "BrowseNodeInfo" };
            request.BrowseNodeId = new string[] { "330405011" };
            BrowseNodeLookup lookup = new BrowseNodeLookup();
            lookup.AssociateTag = ConfigurationManager.AppSettings["associateTag"];
            lookup.AWSAccessKeyId = ConfigurationManager.AppSettings["accessKeyId"];
            lookup.Request = new BrowseNodeLookupRequest[] { request };

            AWSECommerceServicePortTypeClient amazonClient = AmazonHelper.BuildAmazonClient();
            BrowseNodeLookupResponse response = amazonClient.BrowseNodeLookup(lookup);
            if (response != null)
            {
                foreach (var node in response.BrowseNodes[0].BrowseNode)
                {
                    Console.WriteLine(node.Name + " " + node.BrowseNodeId);
                    if(node.Children != null)
                    foreach (var kid in node.Children)
                    {
                        Console.WriteLine("---" + kid.Name + " " + kid.BrowseNodeId);
                    }
                }
            }*/
           

            AmazonDownloader amdl = new AmazonDownloader();
            amdl.runDownload();
            Console.ReadKey();
           
           
        }


      
    }
}
